import _objectSpread from '@babel/runtime/helpers/esm/objectSpread2';
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
import { TreeSelect as AntdTreeSelect } from 'antd';
import React from 'react';
import { useFieldContext } from '../../contexts/FieldContext';
import createField from '../../createField';
var _excluded = ['children'];
/* @ts-ignore */
var TreeSelect = function TreeSelect(_ref) {
  var children = _ref.children,
    rest = _objectWithoutProperties(_ref, _excluded);
  var _useFieldContext = useFieldContext(),
    label = _useFieldContext.label;
  return /*#__PURE__*/ React.createElement(
    AntdTreeSelect,
    _objectSpread(
      {
        placeholder: '\u8BF7\u8F93\u5165'.concat(label),
      },
      rest,
    ),
    children,
  );
};
var TreeSelectField = createField(TreeSelect);
var FinalTreeSelect = TreeSelectField;
FinalTreeSelect.TreeNode = AntdTreeSelect.TreeNode;
FinalTreeSelect.SHOW_ALL = AntdTreeSelect.SHOW_ALL;
FinalTreeSelect.SHOW_PARENT = AntdTreeSelect.SHOW_PARENT;
FinalTreeSelect.SHOW_CHILD = AntdTreeSelect.SHOW_CHILD;
export default FinalTreeSelect;
